home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / bbs / pad311.zip / CHECKNUM.MEX < prev    next >
Text File  |  1996-08-21  |  838b  |  41 lines

  1. #ifndef __MAX_MH
  2. #include <max.mh>
  3. #define __MAX_MH
  4. #endif
  5.  
  6. #include "checknum.mh"
  7. #include "hacks.mh"
  8.  
  9. int main () {
  10.   string: phoneNum, token, params, newPhone, prettyPhone;
  11.   int: dialType, fd;
  12.  
  13.  
  14.   if (fileexists (phoneTempFile) = False) return 0;
  15.  
  16.   fd := open (phoneTempFile, IOPEN_READ);
  17.   readln (fd, newPhone);
  18.   readln (fd, prettyPhone);
  19.   close (fd);
  20.   phoneNum := newPhone;
  21.   stripNonNumeric (phoneNum);
  22.  
  23.   dialType := checkPhone (phoneNum);
  24.  
  25.   if ((dialType = DNLD) or (dialType = DNLOCAL)) {
  26.     fd := open (checkNumTempFile, IOPEN_WRITE | IOPEN_CREATE);
  27.     writeln (fd,itostr (dialType));
  28.     writeln (fd,phone_number);
  29.     writeln (fd,prettyPhone);
  30.     writeln (fd,city);
  31.     close (fd);
  32.     }
  33.   else {
  34.     show_file (fail_file);
  35.     };
  36.  
  37.   remove (phoneTempFile);
  38.   return 0;
  39.   }
  40.  
  41.